package com.woniuxy.test01;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Author author
 * @Create 2023-09-12 9:49
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
//标记接口
public class Student implements Cloneable{
    private int id;
    private String name;
    private int age;
    private School school;

    @Override
    public Student clone() throws CloneNotSupportedException {
        Student student= (Student) super.clone();
        student.setSchool(school.clone());
        return student;
    }
}
